import React, { Component } from "react";
import { Table, Icon, Button, Select } from "antd";
import LinkButton from "../../../components/link-button";
const { Option } = Select;
class consequence extends Component {
  constructor(props) {
    super(props);
    this.state = {};
  }
  render() {
    const columns = [
      {
        title: "资产名称",
        dataIndex: "name",
      },

      {
        title: "合规检测状态",
        width: 800,
        dataIndex: "status",
      },

      {
        title: "操作",
        dataIndex: "handle",
        render: () => (
          <div>
            <LinkButton
              onClick={() => this.props.history.push("/EquipmentAccess/detail")}
            >
              修复
            </LinkButton>
            &nbsp;&nbsp;&nbsp;&nbsp;
            <LinkButton>详情</LinkButton>
            &nbsp;&nbsp;&nbsp;&nbsp;
            <LinkButton
              onClick={() =>
                this.props.history.push("/EquipmentAccess/consequence")
              }
            >
              验证
            </LinkButton>
          </div>
        ),
      },
    ];
    const data = [
      {
        key: "1",
        name: "设置密码失效时间",
        owner: "陈某",
        status: "未通过",
        chart: "缺省客户",
        type: "电脑端设备",
        ip: "192.168.19.23",
      },
    ];

    const rowSelection = {
      onChange: (selectedRowKeys, selectedRows) => {
        console.log(
          `selectedRowKeys: ${selectedRowKeys}`,
          "selectedRows: ",
          selectedRows
        );
      },
      getCheckboxProps: (record) => ({
        name: record.name,
      }),
    };
    return (
      <div>
        <div>
          <div style={{ margin: "15px", fontSize: 18 }}>
            <Icon
              type="rollback"
              style={{ color: "blue", fontSize: "16px" }}
              onClick={() => this.props.history.goBack()}
            />
            &nbsp;&nbsp;风险项
          </div>
          <div style={{ display: "flex", justifyContent: "space-between" }}>
            <div>
              <Button>
                <Icon type="reload" />
              </Button>
            </div>
            <div>
              <Select style={{ width: "200px" }} defaultValue="全部状态">
                <Option value="Home">一个小时</Option>
                <Option value="Company">Company</Option>
              </Select>
              <Select style={{ width: "200px" }} defaultValue="全部类型">
                <Option value="Home">一个小时</Option>
                <Option value="Company">Company</Option>
              </Select>
            </div>
          </div>
        </div>
        <div>
          <Table
            rowSelection={rowSelection}
            columns={columns}
            dataSource={data}
          />
        </div>
      </div>
    );
  }
}

export default consequence;
